.class Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;
.super Ljava/lang/Object;
.source "ApplyAuthCodeActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->initWidgetsActions()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;


# direct methods
.method constructor <init>(Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;)V
    .registers 2
    .param p1, "this$0"    # Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;

    .prologue
    .line 75
    iput-object p1, p0, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;->this$0:Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .registers 12
    .param p1, "v"    # Landroid/view/View;

    .prologue
    .line 79
    iget-object v3, p0, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;->this$0:Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->mEmailEdt:Landroid/widget/EditText;
    invoke-static {v3}, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->access$000(Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;)Landroid/widget/EditText;

    move-result-object v3

    invoke-virtual {v3}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    .line 80
    .local v1, "email":Ljava/lang/String;
    iget-object v3, p0, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;->this$0:Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->mIntroEdt:Landroid/widget/EditText;
    invoke-static {v3}, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->access$100(Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;)Landroid/widget/EditText;

    move-result-object v3

    invoke-virtual {v3}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    .line 81
    .local v2, "intro":Ljava/lang/String;
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-eqz v3, :cond_31

    .line 82
    const v3, 0x7f0c00d8

    invoke-static {v3}, Lcom/brixd/niceapp/util/ToastUtils;->show(I)V

    .line 111
    :goto_30
    return-void

    .line 86
    :cond_31
    invoke-static {v1}, Lcom/zuiapps/suite/utils/string/StringUtils;->isEmail(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_3e

    .line 87
    const v3, 0x7f0c0065

    invoke-static {v3}, Lcom/brixd/niceapp/util/ToastUtils;->show(I)V

    goto :goto_30

    .line 91
    :cond_3e
    iget-object v3, p0, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;->this$0:Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;

    # invokes: Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->getContext()Landroid/content/Context;
    invoke-static {v3}, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->access$200(Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;)Landroid/content/Context;

    move-result-object v3

    invoke-static {v3}, Lcom/brixd/niceapp/util/KeyboardController;->hideKeyboard(Landroid/content/Context;)V

    .line 93
    invoke-static {}, Lcom/brixd/niceapp/service/UserService;->getLoginUser()Lcom/brixd/niceapp/model/UserModel;

    move-result-object v9

    .line 94
    .local v9, "userModel":Lcom/brixd/niceapp/model/UserModel;
    invoke-virtual {v9}, Lcom/brixd/niceapp/model/UserModel;->getUid()I

    move-result v3

    invoke-static {v3}, Lcom/brixd/niceapp/util/SecrUtils;->makeToken(I)Lcom/brixd/niceapp/model/Token;

    move-result-object v8

    .line 95
    .local v8, "token":Lcom/brixd/niceapp/model/Token;
    iget-object v3, p0, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;->this$0:Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;

    # invokes: Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->getContext()Landroid/content/Context;
    invoke-static {v3}, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;->access$300(Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity;)Landroid/content/Context;

    move-result-object v3

    invoke-static {v3}, Lcom/brixd/niceapp/service/adapter/ReqRestAdapter;->niceAppAdapter(Landroid/content/Context;)Lretrofit/RestAdapter;

    move-result-object v3

    const-class v4, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    invoke-virtual {v3, v4}, Lretrofit/RestAdapter;->create(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    .line 96
    .local v0, "request":Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;
    invoke-virtual {v9}, Lcom/brixd/niceapp/model/UserModel;->getUid()I

    move-result v3

    invoke-virtual {v8}, Lcom/brixd/niceapp/model/Token;->getTimestamp()J

    move-result-wide v4

    invoke-virtual {v8}, Lcom/brixd/niceapp/model/Token;->getSecr()Ljava/lang/String;

    move-result-object v6

    new-instance v7, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2$1;

    invoke-direct {v7, p0}, Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2$1;-><init>(Lcom/brixd/niceapp/community/activity/ApplyAuthCodeActivity$2;)V

    invoke-interface/range {v0 .. v7}, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;->applyAuthCode(Ljava/lang/String;Ljava/lang/String;IJLjava/lang/String;Lretrofit/Callback;)V

    goto :goto_30
.end method
